home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 5 / Eagles_Nest_Mac_Collection_Disc_5.TOAST / Science & Religion / Culture20#5 / Culture 5 of 9 / ©1988-91 CRI Inc. / stack.txt < prev   
Text File  |  1992-08-18  |  26KB  |  731 lines

  1. -- stack: in.
  2. -- format: 10 (HyperCard 2)
  3. -- flags: 0x1400 (can't peek)
  4. -- protect password hash: 881254725
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=323, x2=96, y2=483)
  7. -- screen: Rect(x1=0, y1=0, x2=640, y2=480)
  8. -- card dimensions: w=96 h=160
  9. -- scroll: x=0 y=0
  10. -- background count: 1
  11. -- first background id: 2778
  12. -- card count: 1
  13. -- first card id: 3027
  14. -- list block id: 4632
  15. -- print block id: 4008
  16. -- font table block id: 3477
  17. -- style table block id: 3314
  18. -- free block count: 2
  19. -- free size: 1472 bytes
  20. -- total size: 32768 bytes
  21. -- stack block size: 23040 bytes
  22. -- created by hypercard version: 0x02006027
  23. -- compacted by hypercard version: 0x02108000
  24. -- modified by hypercard version: 0x02108000
  25. -- opened by hypercard version: 0x02108000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0xA4EA34A2
  67. ----- HyperTalk script -----
  68. -- T H I S  S T A C K  I S  P R O T E C T E D  B Y  F E D E R A L  C O P Y R I G H T  L A W S
  69. -- A N Y  U N A U T H O R I Z E D  U S E  (OR MODIFICATION)  I S  S T R I C T L Y
  70. -- P     R     O     H      I      B      I     T     E       D
  71. -------------------------------------------------------------------------------------------------
  72. -- This software has been licensed to CRI under 3/19/90 AI/CRI Agreement
  73. -- HyperTag‚Ñ¢, Original Graphic Design, HyperTalk Programming -- and Stack Design ¬© 1988-1992 Applied Imagination Inc.  All Rights Reserved
  74. -- Implemented by Thomas Tafuto - AI/Applied Imagination, Inc.
  75. -- 64 Morton Street ‚Ä¢ 1B  New York, NY  10014  TELE:212 645.7199 - FAX:212 645.7585 - LINK:  AI
  76. -------------------------------------------------------------------------------------------------
  77. -- This Stack Incorporates a third party commercial XFCN
  78. -- PopMenu XFCN ¬© 1988 Appropriate Technology. All rights reserved.
  79. -- PopMenu XFCN documentation ¬© 1988 Kirk Scott. All rights reserved.
  80. -------------------------------------------------------------------------------------------------
  81. -------------------------------------------------------------------------------------------------
  82. -------------------------------------------------------------------------------------------------
  83. on doMenu m
  84.   if m="Find..." then NavigationSearch
  85.   pass doMenu
  86. end doMenu
  87.  
  88. on openStack
  89.   global masterLinkList,CultureStacks,externalLinkList,display
  90.   put "" into masterLinkList
  91.   put "" into externalLinkList
  92.   put "Culture¬Æ OverView,Cultural Almanac,Biblical History,Greece,Rome,Middle Ages  (400-1400),Renaissance  (1400-1600),Baroque  (1600-1750),Classic  (1750-1803),Romantic  (1803-1912),20th Century  (1912-1991),Discipline MacroView,Notes" into CultureStacks
  93.   if short name of this stack is in CultureStacks then
  94.     set textArrows to false
  95.     if the screenRect="0,0,512,342" then put "small" into Display
  96.     else put "large" into Display
  97.     if Display="large" then set loc of cd window to "48,79"
  98.     if "Period Navigation" is not in the windows
  99.     then palette "Period Navigation","0,-42"
  100.     if "Culture Tools" is not in the windows
  101.     then palette "Culture Tools", "272,-42"
  102.     if "Standard Navigation" is not in the windows
  103.     then palette "Standard Navigation", "447,-42"
  104.     if Display="small" then
  105.       set loc of cd window to "0,0"
  106.       set loc of window "Period Navigation" to "1,0"
  107.       set loc of window "Culture Tools" to "272,0"
  108.       set loc of window "Standard Navigation" to "447,0"
  109.     end if
  110.   end if
  111.   pass openStack
  112. end openStack
  113.  
  114. on returnKey
  115.   global gFindWhat
  116.   if gFindWhat‚â†"" then find whole gFindWhat
  117.   else pass returnKey
  118. end returnKey
  119. on convertLinks
  120.   global masterLinkList,externalLinkList,CultureStacks
  121.   --repeat with s=1 to the number of items in CultureStacks
  122.   --go cd "HyperTags" of stack item s of CultureStacks
  123.   put word 1 of short name of this stack&&"HyperTag‚Ñ¢" into fileName
  124.   put "" into MasterLinkList --the master specification
  125.   --put "0" into totalLength --the length of the specification
  126.   --open file fileName
  127.   repeat
  128.     read from file fileName for 16384
  129.     put it after MasterLinkList
  130.     if length(MasterLinkList) = totalLength then exit repeat
  131.     else put length(MasterLinkList) into totalLength
  132.   end repeat
  133.   close file fileName
  134.   --put word 1 of short name of this stack&&"ExternalLinks" into fileName
  135.   --put "" into externalLinkList
  136.   --put "0" into totalLength --the length of the specification
  137.   --put "Loading External links for stack:"&"e&short name of this stack"e
  138.   --open file fileName
  139.   --repeat
  140.   --read from file fileName for 16384
  141.   --put it after externalLinkList
  142.   --if length(externalLinkList) = totalLength then exit repeat
  143.   --else put length(externalLinkList) into totalLength
  144.   --end repeat
  145.   -- close file fileName
  146.  
  147.   --hide msg
  148.   setFlds
  149.   put masterLinkList into ConvertList
  150.   repeat with i=1 to (the number of lines in ConvertList)
  151.     put "1" into IndexLetter
  152.     set the cursor to busy
  153.     if line i of ConvertList="" then
  154.       delete line i of ConvertList
  155.       next repeat
  156.     end if
  157.     if char 1 of item 2 of line i of ConvertList is not in "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9"
  158.     then put "1" into IndexLetter
  159.   else put char 1 of item 2 of line i of ConvertList into IndexLetter
  160.   put line i of ConvertList
  161.   delete last item of line i of ConvertList
  162.   if the number of chars in fld ("Index-"&IndexLetter)<30000 then
  163.     put line i of ConvertList&return after fld ("Index-"&IndexLetter)
  164.   else put line i of ConvertList&return after fld ("Index-5")
  165. end repeat
  166. --go next
  167. --go cd "Externals" of stack item s of CultureStacks
  168. -- setFlds
  169. --put externalLinkList into ConvertList
  170. --repeat with i=1 to (the number of lines in ConvertList)
  171. -- put "1" into IndexLetter
  172. --set the cursor to busy
  173. --if line i of ConvertList="" then
  174. -- delete line i of ConvertList
  175. -- next repeat
  176. -- end if
  177. -- if char 1 of line i of ConvertList is not in "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9"
  178. -- then put "1" into IndexLetter
  179. -- else put char 1 of line i of ConvertList into IndexLetter
  180. -- put line i of ConvertList
  181. -- if the number of chars in fld ("Index-"&IndexLetter)<30000 then
  182. --   put line i of ConvertList&return after fld ("Index-"&IndexLetter)
  183. -- else put line i of ConvertList&return after fld ("Index-5")
  184. --end repeat
  185. --LoadLinkFlds
  186. --end repeat
  187. end convertLinks
  188.  
  189. on LoadLinkFlds
  190.   global masterLinkList,externalLinkList
  191.   repeat with f=1 to 36
  192.     set cursor to busy
  193.     if fld f of cd HyperTags‚â†"" then put fld f of cd HyperTags after masterLinkList
  194.   end repeat
  195.   repeat with f=1 to 36
  196.     set cursor to busy
  197.     if fld f of cd Externals‚â†"" then put fld f of cd Externals after externalLinkList
  198.   end repeat
  199. end LoadLinkFlds
  200. on setFlds
  201.   repeat with f=1 to 36
  202.     set cursor to busy
  203.     set rect of fld f to rect of fld 10
  204.     set textStyle of fld f to textStyle of fld 10
  205.     set textFont of fld f to textFont of fld 10
  206.     set textSize of fld f to textSize of fld 10
  207.     set textHeight of fld f to "10"
  208.     put "" into fld f
  209.   end repeat
  210. end setFlds
  211. on IndexSetUp
  212.   global CurrentIndex
  213.   repeat with f=1 to 35
  214.     hide bg fld F
  215.     set the hilite of bg btn f to false
  216.   end repeat
  217.   show bg fld "Index-A"
  218.   set the hilite of bg btn "A" to true
  219.   put "A" into CurrentIndex
  220. end IndexSetUp
  221. On SwitchDex Targ,TargID,TargName
  222.   global CurrentIndex
  223.   set hilite of targ to true
  224.   if not the visible of fld ("Index-"&targName) then
  225.     lock screen
  226.     set the hilite of bg btn CurrentIndex to false
  227.     hide bg fld ("Index-"&CurrentIndex)
  228.     set the visible of fld ("Index-"&targName) to true
  229.     set the scroll of fld ("Index-"&targName) to 0
  230.     put targName into CurrentIndex
  231.     set the hilite of targ to true
  232.   end if
  233.   unlock screen with visual dissolve
  234. end SwitchDex
  235.  
  236. on BtnToCdLink
  237.   visual zoom open fast
  238.   go cd short name of target
  239.   if the result‚â†"" then answer "Currently, there is no card:"&return"e&short name of target"e
  240. end BtnToCdLink
  241.  
  242. on AddThisToMasterList
  243.   --48758|Baroque  (1600-1750)|cantata,
  244.   push cd
  245.   put selection into LinkTextTo
  246.   put word 3 of the id of this cd into Cdid
  247.   put short name of this stack into LinkedStack
  248.   go stack HyperTagLinker
  249.   ask "Type (or paste) text to link to your last selection‚Ķ"
  250.   put it into TextLink
  251.   put TextLink&","&Cdid&"|"&LinkedStack&"|"&LinkTextTo&","&return after cd fld 1
  252.   pop cd
  253. end AddThisToMasterList
  254.  
  255. on videoPopUp
  256.   global externalLinkList
  257.   put script of target into list
  258.   delete line 1 to 3 of list
  259.   put (the number of lines in list)/2 into PopHere
  260.   changeCurs 7
  261.   get PopMenu (bottom of target+1,left of target+1,PopHere,list)
  262.   if it = empty then answer "Hold mouse button down for a menu of images‚Ķ"
  263.   else
  264.     if item 4 of it‚â†"-" and item 4 of it‚â†"" then
  265.       --if item 3 of it="1" then answer "This is the artist's name‚Ķ"
  266.       --else
  267.       if externalLinkList="" then LoadLinkFlds
  268.       put item 4 of it into Image
  269.       get find(externalLinkList,Image,"item","exact")
  270.       put item 1 of it into returnLine
  271.       put item 2 of line returnLine of externalLinkList into theStartFrame
  272.       if the number of items in line returnLine of externalLinkList="3" then
  273.         put item 3 of line returnLine of externalLinkList into theEndFrame
  274.         video play,theStartFrame,theEndFrame
  275.       else video search,theStartFrame -- Uncomment this line for disc link
  276.       put theStartFrame&&theEndFrame
  277.     end if
  278.   end if
  279. end videoPopUp
  280.  
  281. on CDPopUp
  282.   global externalLinkList
  283.   put script of target into list
  284.   delete line 1 to 3 of list
  285.   put (the number of lines in list)/2 into PopHere
  286.   changeCurs 7
  287.   get PopMenu (bottom of target+1,left of target+1,PopHere,list)
  288.   if it = empty then answer "Hold mouse button down for a menu of images‚Ķ"
  289.   else
  290.     if item 4 of it‚â†"-" and item 4 of it‚â†"" then
  291.       --if item 3 of it="1" then answer "This is the artist's name‚Ķ"
  292.       --else
  293.       if externalLinkList="" then LoadLinkFlds
  294.       put item 4 of it into Title
  295.       get find(externalLinkList,Title,"item","exact")
  296.       put item 1 of it into returnLine
  297.       put item 2 of line returnLine of externalLinkList into theTrack
  298.       if the number of items in line returnLine of externalLinkList="3" then
  299.         put item 3 of line returnLine of externalLinkList into theEndTrack
  300.         CDPlayTrack theTrack,theEndTrack
  301.       else CDPlayTrack theTrack  -- Uncomment this line for disc link
  302.       --CDPlayTrack trackNumber <,trackNumber>
  303.     end if
  304.   end if
  305. end CDPopUp
  306.  
  307. on DoNewCard
  308.   put short name of this cd into PrevCardName
  309.   if last char of PrevCardName is in "0,1,2,3,4,5,6,7,8,9" then
  310.     add 1 to last char of PrevCardName
  311.   end if
  312.   type "N" with commandKey
  313.   ask "Type in name for this card‚Ķ" with PrevCardName
  314.   set name of this cd to it
  315.   put it into fld "Card Name"
  316. end DonewCard
  317.  
  318. on PopNav t,l,menuName
  319.   changeCurs 7
  320.   get PopMenu (t,l,0,"|r"&menuName)
  321.   if menuName="OverView" then put "Culture¬Æ OverView" into targStack
  322.   else if menuName="Intro" then put "Culture¬Æ OverView" into targStack
  323.   else if menuName="Biblical" then put "Biblical History" into targStack
  324.   else if menuName="Greece" then put "Greece" into targStack
  325.   else if menuName="Rome" then put "Rome" into targStack
  326.   else if menuName="MiddleAges" then put "Middle Ages  (400-1400)" into targStack
  327.   else if menuName="Renaissance" then put "Renaissance  (1400-1600)" into targStack
  328.   else if menuName="Baroque" then put "Baroque  (1600-1750)" into targStack
  329.   else if menuName="Classic" then put "Classic  (1750-1803)" into targStack
  330.   else if menuName="Romantic" then put "Romantic  (1803-1912)" into targStack
  331.   else if menuName="Century" then put "20th Century  (1912-1991)" into targStack
  332.   if it = empty then
  333.     visual zoom out
  334.     if menuName="Intro" then go cd Introduction of stack targStack
  335.     else
  336.       go cd 1 of stack targStack
  337.       visual dissolve
  338.       go cd targStack of stack targStack
  339.     end if
  340.   else
  341.     if item 4 of it‚â†"-" and item 4 of it‚â†"" then
  342.       put item 4 of it into targCard
  343.       if targStack is not in "Biblical History,Greece,Rome,Culture¬Æ OverView"
  344.       then delete last word of targCard
  345.       visual zoom open
  346.       go cd targCard of stack targStack
  347.     end if
  348.   end if
  349.   set hilitedbutton of window "Period Navigation" to false
  350. end PopNav
  351. on setRects
  352.   repeat with i=1 to the number of bg btns
  353.     if "externalLink" is in the script of bg btn i
  354.     then set the style of bg btn i to transparent
  355.   end repeat
  356. end setRects
  357. on externalLink
  358.   answer "Cool‚Ķ"
  359. end externalLink
  360. on ShiftBtnLocs
  361.   repeat with i=1 to the number of cd btns
  362.     put the loc of cd btn i into theNewLoc
  363.     subtract 51 from item 1 of theNewLoc
  364.     set loc of cd btn i to theNewLoc
  365.   end repeat
  366. end ShiftBtnLocs
  367. --on videoMenu theDirection,t,l
  368. put "Step,Timed Step‚Ķ,-|(,Play,Slowest,Fast,-|(,Scan" into list
  369. get PopMenu (t,l,0,list)
  370. if it = empty then doVideo step,theDirection,true
  371. else
  372.   if item 4 of it‚â†"-" or item 4 of it‚â†"" then
  373.     if item 4 of it="Timed Step‚Ķ" then
  374.       ask "Please type in the interval at which you would like to step through the frames in this videodisc‚Ķ  (in seconds)" with "5"
  375.       if it ‚â†"" then
  376.         put it into Interval
  377.         repeat until the mouseClick
  378.           put "Stepping through videodisc w/"&Interval&&"second pauses, (Click to stop‚Ķ)‚Ķ"
  379.           go next
  380.           wait interval seconds
  381.         end repeat
  382.         hide msg
  383.       end if
  384.     else doVideo (item 4 of it),theDirection,true
  385.   end if
  386. end if
  387. end videoMenu
  388. --on doVideo what,direction,link
  389. if what‚â†"Stop" then push cd
  390. video what,direction
  391. end doVideo
  392.  
  393. on openCard
  394.   global CultureStacks,display
  395.   if short name of this stack is in CultureStacks then
  396.     if the number of this cd="1" and display="small" then hidePalettes
  397.     else showPalettes
  398.     if "Period Navigation" is not in the windows then openStack
  399.     if "Culture Tools" is not in the windows then openStack
  400.     if "Standard Navigation" is not in the windows then openStack
  401.     if short name of this cd is not in fld "Card Name"
  402.     then put short name of this cd into fld "Card Name"
  403.     hide fld "Card Name"
  404.   end if
  405.   if there is a bg fld "SubTopic" and  "." is not in short name of this cd then select text of fld "SubTopic"
  406.   if short name of this bg="Essays" and short name of this stack is not in "Culture¬Æ OverView,Greece, Rome, Biblical History" then --
  407.     set name of bg btn id 183 to short name of this cd
  408.     if bg fld 2‚â†"" then
  409.       put bg fld 2 into Holder
  410.       repeat until "/" is not in holder
  411.         get offset ("/",holder)
  412.         if it‚â†0 then delete char 1 to it of holder
  413.       end repeat
  414.       set icon of bg btn id 183 to Holder
  415.     end if
  416.     if "General Essay" is in bg fld "SubTopic" then hide bg btn id 182
  417.     else show bg btn id 182
  418.   end if
  419.   pass openCard
  420. end openCard
  421.  
  422. on hidePalettes
  423.   if "Period Navigation" is in the windows then hide window "Period Navigation"
  424.   if "Culture Tools" is in the windows then hide window "Culture Tools"
  425.   if "Standard Navigation" is in the windows then hide window "Standard Navigation"
  426. end hidePalettes
  427.  
  428. on showPalettes
  429.   if "Period Navigation" is in the windows then show window "Period Navigation"
  430.   if "Culture Tools" is in the windows then show window "Culture Tools"
  431.   if "Standard Navigation" is in the windows then show window "Standard Navigation"
  432. end showPalettes
  433.  
  434.  
  435. on CompactAllStacks
  436.   global CultureStacks,performingSearch
  437.   repeat with i=1 to the number of items in CultureStacks
  438.     set the cursor to busy
  439.     go stack (item i of CultureStacks)
  440.     protect
  441.     put "Now Compacting stack:"&&short name of this stack
  442.     doMenu "Compact Stack"
  443.   end repeat
  444.   go home
  445.   answer "All BCAT Stacks have been compacted (optimized)."
  446. end CompactAllStacks
  447. on Navigate
  448.   put script of target into list
  449.   delete line 1 to 3 of list
  450.   changeCurs 7
  451.   get PopMenu (bottom of target+1,left of target+1,0,list)
  452.   if it = empty then
  453.     put short name of target into targStack
  454.     set the hilite of target to false
  455.     visual zoom out
  456.     go cd 1 of stack targStack
  457.     wait 30 ticks
  458.     visual dissolve
  459.     go cd targStack of stack targStack
  460.   else
  461.     if item 4 of it = "-" or item 4 of it = "" then exit Navigate
  462.     else
  463.       set the hilite of target to false
  464.       put short name of target into targStack
  465.       put item 4 of it into targCard
  466.       if short name of target is not in "Biblical History,Greece,Rome" then delete last word of targCard
  467.       visual zoom open
  468.       go cd targCard of stack targStack
  469.     end if
  470.   end if
  471. end Navigate
  472. on Essay
  473.   put script of target into list
  474.   delete line 1 to 3 of list
  475.   get PopMenu (bottom of target+1,left of target+1,0,list)
  476.   if it=empty then
  477.     answer "Hold the mouse down for a list of essays‚Ķ"
  478.     exit essay
  479.   end if
  480.   if item 4 of it = "-" or item 4 of it = "" then exit Essay
  481.   put item 4 of it into targCard
  482.   visual zoom open very fast
  483.   go cd targCard
  484. end Essay
  485.  
  486. on MacroView
  487.   put script of target into list
  488.   delete line 1 to 3 of list
  489.   changeCurs 7
  490.   get PopMenu (bottom of target+1,left of target,0,list)
  491.   if it = empty then
  492.     visual zoom out
  493.     put short name of target into targCard
  494.     go cd targCard of stack "Culture¬Æ OverView"
  495.     if the result is not empty then
  496.       lock screen
  497.       put targCard into temp
  498.       answer "No card exists for:" && targCard with Cancel or Create
  499.       if it = "Create" then
  500.         push card
  501.         go last cd of bg "Essays"
  502.         domenu New Card
  503.         set name of this cd to temp
  504.         put short name of target into bg fld 1
  505.         unlock screen with visual iris open
  506.       end if
  507.     end if
  508.   else
  509.     if item 4 of it = "-" or item 4 of it = "" or item 4 of it = "Empty" then exit MacroView
  510.     else
  511.       if item 2 of it‚â•"A" then
  512.         put item 4 of it into targCard
  513.         visual zoom open very fast
  514.         go cd targCard of stack "Culture¬Æ OverView"
  515.         if the result is not empty then
  516.           lock screen
  517.           put targCard into temp
  518.           answer "No card exists for:" && targCard with Cancel or Create
  519.           if it = "Create" then
  520.             push card
  521.             go last cd of bg "Essays"
  522.             domenu New Card
  523.             set name of this cd to temp
  524.             put targCard into bg fld 1
  525.             unlock screen with visual iris open
  526.           end if
  527.         end if
  528.       end if
  529.     end if
  530.   end if
  531. end MacroView
  532.  
  533.  
  534. on PopAlmanac t,l,menuName
  535.   changeCurs 7
  536.   get PopMenu (t,l,0,"|r"&menuName)
  537.   if it = empty then
  538.     visual zoom out
  539.     go stack "Cultural Almanac"
  540.   else if item 4 of it‚â†"-" and item 4 of it‚â†"" then
  541.     put item 4 of it into TheMonth
  542.     ask "Please type in the day you want to find‚Ķ" with "15"
  543.     put it into theDay
  544.     repeat with i=1 to number of chars in theDay
  545.       if char i of theDay is not in "0123456789" then
  546.         type "Not a valid entry, use numerals only‚Ķ"
  547.       end if
  548.     end repeat
  549.     visual dissolve
  550.     go cd (theDay&"  "&theMonth) of stack "Cultural Almanac"
  551.   end if
  552.   set hilitedButton of window "Period Navigation" to false
  553. end PopAlmanac
  554.  
  555. on closeStack
  556.   if the freeSize of me > 50480 then doMenu Compact Stack
  557. end closeStack
  558.  
  559.  
  560. on closebackground
  561.   ---set icon of bg btn BookButton to BookButton
  562.   --if the short name of this bg="Essays" then
  563.   -- if the visible of bg btn "Return" then hide bg btn "Return"
  564.   --end if
  565. end closebackground
  566. on EnterKey
  567.   global CulturePath
  568.   if the CommandKey is down then
  569.     get offset(short name of this cd,CulturePath)
  570.     if it=0
  571.     then put the short name of this cd&" ["&short name of this stack&","&return after CulturePath
  572.   else answer "This card is already in the loaded Culture Path‚Ķ"
  573.   exit EnterKey
  574. end if
  575. CompleteLink
  576. end EnterKey
  577. on CompletePathLink
  578.   global LinkStat,LinkFromCd,LinkFromStak,LinkToCd,LinkToStak
  579.   if LinkStat‚â†"true" then exit CompleteLink
  580.   put short name of this cd into LinkToCd
  581.   put short name of this stack into LinkToStak
  582.   visual zoom in
  583.   go cd LinkFromCd of stack LinkFromStak
  584.   put LinkToCd&" ["&LinkToStak&","&return into newScript
  585.   get script of this cd
  586.   set script of this cd to it&newScript
  587.   if the script of this cd‚â†"" then set hilite of bg btn Linker to true
  588.   put "" into LinkStat
  589. end CompletePathLink
  590. on Levels
  591.   set cursor to 4
  592.  
  593.   if short name of this stack="Biblical History" then
  594.     visual zoom in
  595.     go cd (short name of target)
  596.   else if short name of target‚â†short name of this cd then
  597.     if short name of this bg="Essays" and the id of the target=182 then
  598.       put bg fld 1 into targCard
  599.       delete last word of targCard
  600.     else put short name of target into targCard
  601.     visual zoom in
  602.     go cd targCard
  603.   else
  604.     beep
  605.     answer "This button represents the current card:"&return&short name of this cd
  606.   end if
  607. end Levels
  608. on Notes
  609.   set userModify to false
  610.   set cursor to 4
  611.   if not the visible of bg fld id 122 then
  612.     lock screen
  613.     hide bg btn cover
  614.     show bg btn CloseBox
  615.     show bg btn "Do Reports‚Ķ"
  616.     hide card picture
  617.     repeat with i=1 to number of bg btns
  618.       if "blackout" is in short name of bg btn i then show bg btn i
  619.     end repeat
  620.     repeat with i=1 to the number of card buttons
  621.       hide cd btn i
  622.     end repeat
  623.     show bg fld id 122
  624.     unlock screen with visual zoom open very fast
  625.     set userModify to true
  626.     exit Notes
  627.   end if
  628.   if the visible of bg fld id 122 then
  629.     set the scroll of bg fld id 122 to 0
  630.     lock screen
  631.     show cd picture
  632.     repeat with i=1 to the number of card buttons
  633.       show cd btn i
  634.     end repeat
  635.     repeat with i=1 to number of bg btns
  636.       if "blackout" is in short name of bg btn i then hide bg btn i
  637.     end repeat
  638.     if bg fld id 122 ‚â†"" then set the hilite of target to true
  639.     show bg btn cover
  640.     hide bg btn CloseBox
  641.     hide bg fld id 122
  642.     hide bg btn "Do Reports‚Ķ"
  643.     unlock screen with visual zoom close very fast
  644.   end if
  645.   set userModify to true
  646. end notes
  647. on essayLinkage
  648.   set userModify to false
  649.   set cursor to 4
  650.   if not the visible of bg fld id 183 then
  651.     lock screen
  652.     hide cd picture
  653.     repeat with i=1 to the number of card buttons
  654.       hide cd btn i
  655.     end repeat
  656.     show bg fld id 183
  657.     unlock screen with visual zoom open very fast
  658.     set hilite of target to true
  659.     set userModify to true
  660.     exit essayLinkage
  661.   end if
  662.   if the visible of bg fld id 183 then
  663.     set the scroll of bg fld id 183 to 0
  664.     lock screen
  665.     if not the visible of bg fld id 122 then
  666.       show cd picture
  667.       repeat with i=1 to the number of card buttons
  668.         show cd btn i
  669.       end repeat
  670.     end if
  671.     hide bg fld id 183
  672.     set the hilite of target to true
  673.     unlock screen with visual zoom close very fast
  674.   end if
  675.   set userModify to true
  676. end essayLinkage
  677. on EssayLink
  678.   visual zoom out
  679.   go cd short name of target
  680. end essayLink
  681. on ExitCultureQuit
  682.   doMenu "Quit HyperCard"
  683. end ExitCultureQuit
  684. on ExitCultureHome
  685.   visual iris close
  686.   go home
  687. end ExitCultureHome
  688. --function lineClicked
  689. return ((the mouseV - item 2 of the rect of the target) div the textHeight of the target) + 1
  690. end lineClicked
  691. --Function Clickline
  692. return (trunc(((scroll of the target) + (item two of the clickloc) - (item two of the rect of the target)) div the textheight of the target) + one)
  693. End Clickline
  694. on GridLink
  695.   if the optionKey is down then
  696.     --answer "Chris, are you sure you want to delete this button?" with "Cancel" or "OK"
  697.     --if it is "OK" then
  698.     choose button tool
  699.     click at the loc of target
  700.     doMenu"Clear Button"
  701.     choose browse tool
  702.     -- end if
  703.     exit GridLink
  704.   end if
  705.   put bg fld CID&short name of target into targCard
  706.   visual zoom out
  707.   go cd targCard
  708.   if the result is not empty then
  709.     lock screen
  710.     put bg fld 1 into tem
  711.     put targCard into temp
  712.     answer "No card exists for:" && targCard with Cancel or Create
  713.     if it = "Create" then
  714.       put number of this cd into JumpBack
  715.       go last cd
  716.       domenu New Card
  717.       set name of this cd to temp
  718.       put tem into bg fld 1
  719.       put short name of target into bg fld 2
  720.       unlock screen with visual iris open
  721.       go cd jumpBack
  722.     end if
  723.   end if
  724. end GridLink
  725.  
  726. on protect
  727.   repeat with i=1 to the number of cds
  728.     set cantDelete of cd i to true
  729.   end repeat
  730. end protect
  731.